<?php
/**
 * +--------------------------------------------------------+
 * @Created by Phpstorm.
 * @Category DataCapJob.php
 * @Depiction
 * @Author hwy <429208948@qq.com>
 * @Date 2021/8/19  14:56
 * +--------------------------------------------------------+
 */

namespace App\Jobs;


use App\Services\MyStockService;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Support\Facades\Cache;

class DataCapJob extends Job
{

    //
    /**
     * 任务可尝试的次数
     *
     * @var int
     */
    public $tries = 5;
    protected $data;

    /**
     * Create a new job instance.
     *
     * @return void
     */
    public function __construct($data)
    {
        $this->data = $data;
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {
        $key = $this->data['key'];
        $t   = $this->data['time'];

        if (class_exists('\App\Util\Stock')) {
            $data = (new \App\Util\Stock())->getFund($key, $t);
        }

        return true;

    }

}
